@extends('admin.base.index')


@section('content')
<!-- Content>
<!-- Messages Drawer -->
	 <div class="block-area" id="defaultStyle">
                    <h3 class="block-title">管理员信息管理</h3>
                    <form action='{{ url("admin/tors") }}' method='post' name='myform'>
                        <input type='hidden' name='_token' value='{{ csrf_token() }}'>
                        <input type='hidden' name='_method' value='DELETE'>
                    </form>
                    <form action='{{ url("admin/tors") }}' method='get'>
                        <div class='media-body'>
                            姓名：<input type='text' class='form-control m-b-5' name='name'>
                        </div>
                        <input type='submit' class='btn' value='搜索'>
                    </form>
                   
                    <table class="table tile">
                        <thead>
                            <tr>
                                <th>编号</th>
                                <th>用户名</th>
                                <th>管理员状态</th>
                                <th>操作</th>
                            </tr>
                            @foreach ($list as $v)
                                <tr>
                                    <td>{{ $v->id }}</td>
                                    <td>{{ $v->name }}</td>
                                    <td>{{ $v->pw==1?"正常":"冻结"}}</td>
                                    <td>
                                        <a href="javascript:doDel({{ $v->id }})" class='btn'>删除</a>
                                        <a href="/admin/tors/{{ $v->id }}/edit" class='btn'>修改</a>
                                    </td>
                                </tr>   
                            @endforeach
                            </tr>
                        </thead>
                        <tbody>
                          
                    </table>
                    <!-- 显示分页，并带上附加搜索参数 -->
                    {{ $list->appends($where)->links() }}
                    <script type="text/javascript">
                        function doDel(id)
                        {
                            if(confirm('确定要删除吗？')){
                                var form = document.myform;
                                form.action = '/admin/tors/'+id;
                                form.submit()
                            }
                        }
                    </script>
                </div>
@stop